<div id="content">

    <? if(is_array($response)){?>
    <div class="response">
        <span class="<?=$response["class"]?>"><?=$response["msg"]?></span>
    </div>
    <? } ?>

    <a class="button" href="<?=site_url('admin/portfolio/add')?>" style="float:right">ADD NEW INSTALLATION</a>
    <h1>Portfolio</h1>

    <div class="live_search_msg"></div>    
    <? foreach($list as $item){ 
        $class = ($item['Approved_Portfolio']!=1)?'unapproved':(($item['Active_Portfolio']=='1')?'active':'inactive');
    ?>

        <div class="product_block search  <?=$class?>">     
            <a href="<?=site_url('admin/portfolio/preview/'.$item['id_Portfolio'])?>" rel="view">
                <img src="<?=thumbnail(base_url().UPLOADS_FOLDER.PORTFOLIO_IMG_FOLDER.$item['Main_Image'])?>" />
                <span class="title">             
                    <?=$item['Name_Portfolio']?>
                </span>
            </a>

            <a href="<?=site_url('admin/portfolio/edit/'.$item['id_Portfolio'])?>" class="button">edit</a>
            <? if($item['Approved_Portfolio']==1) { ?>
                <? if ($item['Active_Portfolio'] == 1){ ?>            
                <a href="<?=site_url('admin/portfolio/deactivate/'.$item['id_Portfolio'])?>" class="button">deactivate</a>
                <? } else { ?> 
                <a href="<?=site_url('admin/portfolio/activate/'.$item['id_Portfolio'])?>" class="button">activate</a>
                <? } ?>
            <? } else if(is_allowed(array(ROLE_ADMIN,ROLE_PUBLISHER))){ ?>
                <a href="<?=site_url('admin/portfolio/approve/'.$item['id_Portfolio'])?>" class="button">approve</a>
            <? } ?>
            
            <a href="<?=site_url('admin/portfolio/remove/'.$item['id_Portfolio'])?>" class="button">delete</a>

            <!--
            <? if ($item['Approved_Portfolio'] == 1){ ?> Approved <? } else { ?> Not approved <? } ?>
            -->

        </div>

    <? } ?>

</div>